package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MrHospitalMapper;
import com.ruoyi.system.domain.MrHospital;
import com.ruoyi.system.service.IMrHospitalService;

/**
 * 医院Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-11-18
 */
@Service
public class MrHospitalServiceImpl implements IMrHospitalService 
{
    @Autowired
    private MrHospitalMapper mrHospitalMapper;

    /**
     * 查询医院
     * 
     * @param hosId 医院主键
     * @return 医院
     */
    @Override
    public MrHospital selectMrHospitalByHosId(Long hosId)
    {
        return mrHospitalMapper.selectMrHospitalByHosId(hosId);
    }

    /**
     * 查询医院列表
     * 
     * @param mrHospital 医院
     * @return 医院
     */
    @Override
    public List<MrHospital> selectMrHospitalList(MrHospital mrHospital)
    {
        return mrHospitalMapper.selectMrHospitalList(mrHospital);
    }

    /**
     * 新增医院
     * 
     * @param mrHospital 医院
     * @return 结果
     */
    @Override
    public int insertMrHospital(MrHospital mrHospital)
    {
        mrHospital.setCreateTime(DateUtils.getNowDate());
        return mrHospitalMapper.insertMrHospital(mrHospital);
    }

    /**
     * 修改医院
     * 
     * @param mrHospital 医院
     * @return 结果
     */
    @Override
    public int updateMrHospital(MrHospital mrHospital)
    {
        mrHospital.setUpdateTime(DateUtils.getNowDate());
        return mrHospitalMapper.updateMrHospital(mrHospital);
    }

    /**
     * 批量删除医院
     * 
     * @param hosIds 需要删除的医院主键
     * @return 结果
     */
    @Override
    public int deleteMrHospitalByHosIds(Long[] hosIds)
    {
        return mrHospitalMapper.deleteMrHospitalByHosIds(hosIds);
    }

    /**
     * 删除医院信息
     * 
     * @param hosId 医院主键
     * @return 结果
     */
    @Override
    public int deleteMrHospitalByHosId(Long hosId)
    {
        return mrHospitalMapper.deleteMrHospitalByHosId(hosId);
    }

}
